home *** CD-ROM | disk | FTP | other *** search
/ FishMarket 1.0 / FishMarket v1.0.iso / fishies / 501-525 / disk_520 / oaklisp / bytecode.lzh / oakliszt < prev   
Text File  |  1991-06-16  |  800b  |  51 lines

  1. #!/bin/csh -f
  2. if ($#argv == 0) then
  3.   set foo = "$0"
  4.   echo "Usage: $foo:t file.oak [locale [switches...]]"
  5.   exit 2
  6. endif
  7.  
  8. if (! $?OAKPATH) setenv OAKPATH /usr/misc/.oaklisp
  9.  
  10. set file = $1:r
  11.  
  12. shift
  13.  
  14. if ($#argv == 0) then
  15.   set locale = "system-locale"
  16. else
  17.   set locale = "$1"
  18.   shift
  19. endif
  20.  
  21. set del = 0
  22.  
  23. if (-e $file.oa) then
  24.   mv -f $file.oa $file.oa~~
  25.   set del = 1
  26. endif
  27.  
  28. set switches = ($argv[1-]:q)
  29. if ($?OAKLISZT) then
  30.   set switches = ($OAKLISZT $switches)
  31. endif
  32. if ($?OAKLISP) then
  33.   set switches = ($OAKLISP $switches)
  34. endif
  35.  
  36. echo $locale $file|$OAKPATH/etc/emulator $switches $OAKPATH/lib/oaklisp.%%z
  37.  
  38. set res = $status
  39.  
  40. if ($res == 0) then
  41.   if ($del == 1) rm -f $file.oa~~
  42.   exit 0
  43. endif
  44.  
  45. if ($del == 1) then
  46.   echo "Reverting object file."
  47.   mv -f $file.oa~~ $file.oa
  48. endif
  49.  
  50. exit $res
  51.